﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Mrkz.ImageManipulation.FrequencyFiltering
{
    /// <summary>
    /// 
    /// </summary>
    public class DFTEngine
    {
        public DFTEngine()
        {
        }

        public TImage<ComplexPixel> ForwardTransform(TImage<Pixel> Source)
        {
            TImage<ComplexPixel> i = ImageFactory<Pixel>.FromImage(Source);

            TImage<ComplexPixel> r = DFTEngineSupportFunctions.ParallelDFT2D(i, 1);

            return r;
        }

        public TImage<Pixel> InverseTransform(TImage<ComplexPixel> Source)
        {
            TImage<ComplexPixel> r = null;

            r = DFTEngineSupportFunctions.ParallelDFT2D(Source, -1);

            return ImageConverter<Pixel,ComplexPixel>.FromImageWithCrop(r);
        }
    }
}
